﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentValidation;
using CashFlow.Admin.Models;

namespace CashFlow.Admin.Validator
{
    public class LoginUserInfoModelValidator : AbstractValidator<LoginUserInfoModel>
    {
        public LoginUserInfoModelValidator()
        {
            RuleFor(x => x.UserName).Matches("\\w{5,20}").WithMessage("用户名格式不正确！");
            RuleFor(x => x.Pwd).Matches("\\w{6,20}").WithMessage("密码格式不正确！");
            RuleFor(x => x.VerCode).Matches("\\w{4}").WithMessage("验证码格式不正确！");
        }
    }
}